<?php
function image($src, $size=null) {
    if (!defined("II_API_ROOT")) {
        return "II_API_ROOT undefined! ";
    }
    $preName = substr($src, 0, strrpos($src, "."));
    if ($size===null) {
        return II_API_ROOT . "/" . $preName . ".jpg";
    }
    return II_API_ROOT . "/" . $preName . "_" . $size . ".jpg";
}
function image_root() {
    return II_API_ROOT;
}